dict = {'sun':'i love you','jin':'i am heiwa','tao':'heiwa is me'}

def getvalues():
    vlist = []
    for i in dict.values():
        list = i.split()
        vlist.extend(list)
    return set(vlist)

data = getvalues()

def get_v():
    ddict = {}
    for i in data:
        keylist = []
        for j in dict.keys():
            if i in dict[j].split():
                keylist.append(j)
        ddict[i] = keylist
    return ddict
da = get_v()
print(da)



